<template>
  <div class="app-container">
    <el-button type="primary">添加角色</el-button>

    <roles-table :rolselist="rolse" @onSuccess="onload" />
  </div>

</template>

<script>
import RolesTable from './components/RolesTable.vue'
import { getRoleList } from '@/api/authority'
export default {
  components: { RolesTable },
  data() {
    return {
      rolse: [] // 角色列表

    }
  },

  created() {
    this.onload()
  },

  methods: {
    async   onload() {
      try {
        const res = await getRoleList()
        // console.log(res)
        this.rolse = res
        this.$message.success('获取角色列表数据成功')
      } catch (err) {
        console.log(err)
      }
    }
  }
}
</script>

<style scoped lang='less'>

</style>
